package org.example.learnjava;


import org.example.learnjava.service.User;
import org.example.learnjava.service.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {

    @SuppressWarnings("resource")
    public static void main(String[] args) {
        ApplicationContext context = new ClassPathXmlApplicationContext("application.xml");
        UserService userService = context.getBean(UserService.class);
        User user = userService.login("bob@example.com", "password");
        System.out.println(user.getName());

        User user1 = userService.login("alice@example.com", "password");
        System.out.println(user1.getName());

        User user2 = userService.login("bob@example.com", "password1");
        System.out.println(user2.getName());
    }

}
